<template>
    <div class="addbooks">
        <p class="p1"><el-button @click="goFun" size="mini" style="margin-right:6px;" icon="el-icon-arrow-left">返回</el-button>{{title}}</p>

        <!-- 添加文章主体 -->
        <div class="books_in">
            
            <writers :form='form'></writers>

        </div>
    </div>
</template>

<script>
import writers from '../../components/write/writers'
export default {
    components:{
        writers
    },
    data () {
        return {
            options: [{
                value: 1,
                label: '开启'
                }, {
                value: 0,
                label: '关闭'
                }],
            value: '',
            input:'',
            form:{},
            title:'添加文章'
        }
    },
    methods:{
        goFun(){
            this.$router.push('/writer')
        }
    },
    created(){
        console.log(this.$route);
        if (this.$route.query) {
            this.form = this.$route.query
            this.title = this.$route.query.title1 === '添加' ? '添加文章' : '编辑文章'
        }
    }
}
</script>

<style lang="scss">
    .addbooks{
        width: 100%;
        height: 100%;
        padding: 0 20px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        .p1{
            width: 100%;
            height: 60px;
            background: white;
            display: flex;
            align-items: center;
            padding: 0 10px;
            box-sizing: border-box;
            font-size: 18px;
        }
        .books_in{
            width: 100%;
            height: 800px;
            background: white;
            margin-top: 16px;
            padding: 0 10px;
            box-sizing: border-box;
            .p2{
                width: 100%;
                height: 50px;
                display: flex;
                justify-content:start;
                align-items: center;
                padding: 36px 20px;
                box-sizing: border-box;
            }
            .p3{
                width: 100%;
                height: 40px;
                display: flex;
                align-items: center;
                padding: 0 20px;
                box-sizing: border-box;
            }
        }
    }

.books_in>.p2>span:nth-child(1){
    width: 36%;
    height: 100%;
    display: flex;
    align-items: center;
}
.books_in>.p2>span:nth-child(2){
    width: 36%;
    height: 100%;
    display: flex;
    align-items: center;
    .inps{
        width: 66%;
    }
    span{
        flex: 1;
        display: block;
        height: 100%;
        display: flex;
        white-space: nowrap;
        align-items: center;
    }
}
</style>